package com.codi.bus.core.service.organ;

import com.codi.bus.core.resultModel.BaseResult;
import com.codi.bus.core.vo.BuyVo;
import com.codi.bus.exception.BaseException;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * Created by asus on 2018/5/8.
 */
public interface OrganTradeService {
    @Transactional
    BaseResult organBuy(BuyVo vo, Long profileId);

    @Transactional(rollbackFor = {BaseException.class})
    BaseResult sell(Long userId, String channelId, String bankAccount, String capitalMode, String fundName,
                        String fundCode, BigDecimal shares, String shareType, String tradePassword, String applyNo, String tradeAccount,Long profileId) throws BaseException;


    @Transactional(rollbackFor = {BaseException.class})
    BaseResult fastRedeemOrgan(Long userId, String channelId, String capitalMode, String tradePassword, String fundCode,
                               String shareType, BigDecimal shares, String bankAccount, String fundName, String applyNo, String tradeAccount, Long profileId);

    void storeData(Map<String, Object> map, String capitalMode, String bankCode, String bankAccount,
                   BigDecimal shares, BigDecimal orderBalance, String orderSn, Long userId, String channelId, String tradeType,
                   Integer orderStatus, Date applyDate, String externalApplyNo, String fundCode, String fundName,
                   String shareType, Integer fundStatus, Long protocolFixDay, String protocolPeriodUnit,
                   String externalScheduledProtocolId, String tradeAccount, Long profileId);

    @Transactional(rollbackFor = {BaseException.class})
    BaseResult organUndoReal(Long userId, String channelId, String originalApplyNo, String tradePassword, Long profileId) throws BaseException;
}
